<%@ page language="java" errorPage="/framework/jsp/error.jsp"
	pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ include file="/cring/jsp/admin/header.jsp"%>
<%@include file="/framework/jsp/taglibs.jsp"%>
<%@ include file="/cring/jsp/admin/menu.jsp"%>
<%@ taglib prefix="xwcms" uri="/WEB-INF/CMSConfig/com.xwtech.cms.tld"%>
<%@page import="com.xwtech.framework.pub.po.FrameLogin,
	        com.xwtech.framework.login.pub.AbstractLoginToken,
	        com.xwtech.framework.pub.utils.SessionUtils,
	        com.xwtech.framework.pub.web.SessionNameConstants" %>
<%
	AbstractLoginToken loginToken = (AbstractLoginToken) SessionUtils
			.getObjectAttribute(session,
					SessionNameConstants.LOGIN_TOKEN);
	String userLoginName = loginToken.getFrameLogin().getLoginName();
%>
<script src="/cring/js/ajax.js" type="text/javascript"></script>
	<script type="text/javascript"> 
function del(login_name) { 
    if(login_name =='<%=userLoginName%>')
    {
        alert("自己不能删除自己！");
        return;
    }
	if(confirm("你确定要删除该用户吗？")){
		this.location = "/cring/jsp/admin/bgUserManager.do?method=deleteBgUser&login_name=" + login_name;
	}
}
function initPassword(login_name) {
	if(confirm("你确定要初始化该用户的密码吗？")){
		this.location = "/cring/jsp/admin/backGroundUser.do?method=initPassword&login_name=" + login_name;
	}
}
function edit(login_name) { 
	this.location = "/cring/jsp/admin/bgUserManager.do?method=getBgUserByLoginname&login_name=" + login_name;
}
function add() { 
	window.location.href = "/cring/jsp/admin/addBackGroundUser.jsp";
}
function pageSubmit(pageNum){
	f1.currentPage.value = pageNum;
	f1.submit();
}
</script>
<br>
<form name="backUserSearchForm" method='post'
	action="/cring/jsp/admin/bgUserList.jsp"
	style="display: inline;">
	<table border='0' align='center' cellspacing='1' cellpadding='0'
		width='100%' class="table_big">
		<tr>
			<td>
				    <table width="100%" border="0" align="center" cellpadding="0"
								cellspacing="0">
						<tr>
							<td width="4" height="4">
								<img src="/cring/image/admin/title_r4_c3.gif" width="4"
											height="4">
							</td>
						    <td height="4">
								<img src="/cring/image/admin/title_r4_c4.jpg" width="100%"
											height="4">
							</td>
							<td width="4" height="4">
										<img src="/cring/image/admin/title_r4_c8.gif" width="4"
											height="4">
							</td>
						</tr>
					</table>
					<table width="100%" border="0" align="center" cellpadding="0"
								cellspacing="0">
						<tr>
							<td width="4" background="/cring/image/admin/title_r5_c3.jpg"
										bgcolor="#CCCCCC">
										&nbsp;
							</td>
							<td bgcolor="#EEF7FD">
							    <table width="98%" border="0" align="center" cellpadding="0"
											cellspacing="4">
							       <tr>
									   <td width="24" align="center">
													<img src="/cring/image/admin/title_r6_c5.gif" width="24"
														height="24">
									   </td>
									   <td class="font_title_normal">
													用户管理
									   </td>
								   </tr>
							    </table>
							    <table width="98%" border="0" align="center" cellpadding="0"
											cellspacing="0">
								   <tr>
										<td height="12" valign="top">
											<table width="100%" border="0" align="center"
														cellpadding="0" cellspacing="1">
												<tr>
													<td height="5"
																background="/cring/image/admin/title_r10_c5.jpg"></td>
												</tr>
										    </table>
									    </td>
								   </tr>
								</table>
								<table width="98%" border="0" cellpadding="0" cellspacing="1"
											class="table_normal">
								   <tr>
									    <td width="100" valign="middle" class="td_item_right">
													登陆帐号:
										</td>
									    <td class="td_normal_left">
													<input type="text" name="login_name" value="<xwcms:write name="login_name" />">
										</td> 
									</tr>
								</table>
								<table border="0" align="center" cellpadding="0"
											cellspacing="20">
									<tr>
										<td>
											<div align="center">
												<input type="submit" class="button_xy_normal" value="查 询 ">
												<input type="button" class="button_xy_normal" value="新增用户" onClick="add();">
												<input type="hidden" name="currentPage" value="1">
											</div>
										</td>
									</tr>
								</table>
							</td>
							<td width="4" background="/cring/image/admin/title_r5_c9.jpg"
										bgcolor="#CCCCCC">
										&nbsp;
							</td>
						</tr>
					</table>
					<table width="100%" border="0" align="center" cellpadding="0"
								cellspacing="0">
						<tr>
							<td width="4" height="4">
										<img src="/cring/image/admin/title_r10_c3.gif" width="4"
											height="4">
							</td>
							<td height="4">
										<img src="/cring/image/admin/title_r12_c4.jpg" width="100%"
											height="4">
							</td>
							<td width="4" height="4">
										<img src="/cring/image/admin/title_r10_c8.gif" width="4"
											height="4">
							</td>
						</tr>
					</table>
				<br>
			</td>
			<td style=''>
				&nbsp;
			</td>
		</tr>
	</table>
</form>
<table width="100%" border="0" align="center" cellpadding="0"
	cellspacing="0" class="table_big">
	<tr>
		<td>
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="4" height="4">
						<img src="/cring/image/admin/title_r4_c3.gif" width="4" height="4">
					</td>
					<td height="4">
						<img src="/cring/image/admin/title_r4_c4.jpg" width="100%"
							height="4">
					</td>
					<td width="4" height="4">
						<img src="/cring/image/admin/title_r4_c8.gif" width="4" height="4">
					</td>
				</tr>
			</table>
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="4" background="/cring/image/admin/title_r5_c3.jpg"
						bgcolor="#CCCCCC">
						&nbsp;
					</td>
					<td bgcolor="#EEF7FD">
						<table width="98%" border="0" align="center" cellpadding="0"
							cellspacing="4">
							<tr>
								<td width="24" align="center">
									<img src="/cring/image/admin/title_r6_c5.gif" width="24"
										height="24">
								</td>
								<td class="font_title_normal">
									用户列表
								</td>
							</tr>
						</table>
						<table width="98%" border="0" align="center" cellpadding="0"
							cellspacing="0">
							<tr>
								<td height="12" valign="top">
									<table width="100%" border="0" align="center" cellpadding="0"
										cellspacing="1">
										<tr>
											<td height="5"
												background="/cring/image/admin/title_r10_c5.jpg"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
						<table width='98%' id="query_table_1215ba3954b" border='0'
							cellspacing='1' cellpadding='0' class='table_normal'>
								<tr>
									<td class='td_item_center'>
										登陆帐号
									</td>
									<td class='td_item_center'>
										姓名
									</td>
									<td class='td_item_center'>
										上次登录时间
									</td>
									<td class='td_item_center'>
										上次登录IP
									</td> 
									<td class='td_item_center'>
										所属用户组
									<td class='td_item_center'>
										密码初始化
									</td>
									<td class='td_item_center'>
										修改
									</td>
									<td class='td_item_center'>
										删除
									</td>
								</tr>
							<tbody id="query_listbody_1215ba3954b">
								<xwcms:datalist bean="datalist"
									name="/admin/bgUserList.xml" totalCount="totalCount"
									pageSize="10" totalPages="totalPages" />

								<xwcms:iterator bean="datalistitem" name="datalist"
									pageSize="10" currentPage="currentPage">
									<tr querye_hasdata="1">
										<td class='td_normal_center'>
											<xwcms:write property="login_name" />
										</td>
										<td class='td_normal_center'>
											<xwcms:write property="user_name" />
										</td>
										<td class='td_normal_center'>
											<xwcms:write property="login_time" />
										</td>
										<td class='td_normal_center'>
											<xwcms:write property="login_ip" />
										</td>
										<td class='td_normal_center'>
											<xwcms:write property="role_name" />
										</td>
										<td class='td_normal_center' style="cursor:pointer" onclick="initPassword('<xwcms:write property='login_name' />')">密码初始化
										</td> 
										<td class='td_normal_center' style="cursor:pointer" onclick="edit('<xwcms:write property='login_name'/>')">修改
										</td>
										<td class='td_normal_center'style="cursor:pointer" onclick="del('<xwcms:write property='login_name'/>')">删除
										</td>
									</tr>
									<tr querye_hasdata="0">
										<td style="display: none;"></td>
									</tr>
								</xwcms:iterator>
							</tbody>
						</table>
						<table width='98%' border='0' align='center' cellpadding='0'
							cellspacing='0'>
							<tr onselectstart='javascript:return false;'>
								<td>
									共查询到
									<span class='font_title_normal'><xwcms:write
											name="totalCount" /> </span>条记录,
									<span class='font_title_normal'><xwcms:write
											name="totalPages" /> </span>页, 当前第



									<span class='font_title_normal'><xwcms:write
											name="currentPage" initValue="1" add="0" /> </span>页



								</td>
								<td align='right'>
									<span class='font_title_normal'>&lt;</span>
									<xwcms:iterator bean="curentPageIndex" name="datalist"
										pageSize="10" maxSize="10" currentPage="currentPageSection"
										paging="true">
										<span class='font_title_normal'><a
											href="bgUserList.jsp?currentPage=<xwcms:write
													name="curentPageIndex" />"><xwcms:write
													name="curentPageIndex" /> </a> </span>
									</xwcms:iterator>
									<span class='font_title_normal'>&gt;</span>
								</td>
							</tr>
						</table>
						<br> 
					</td>
					<td width="4" background="/cring/image/admin/title_r5_c9.jpg"
						bgcolor="#CCCCCC">
						&nbsp;
					</td>
				</tr>
			</table>

			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="4" height="4">
						<img src="/cring/image/admin/title_r10_c3.gif" width="4"
							height="4">
					</td>
					<td height="4">
						<img src="/cring/image/admin/title_r12_c4.jpg" width="100%"
							height="4">
					</td>
					<td width="4" height="4">
						<img src="/cring/image/admin/title_r10_c8.gif" width="4"
							height="4">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<br>
<%@ include file="/cring/jsp/admin/footer.jsp"%>
